import request from '@/utils/request';

// 台站数量统计
export const stationCountApi = () => {
  return request({
    url: '/workbenches/stationCount',
    method: 'GET',
  });
};

// 测震告警列表
export const seismListApi = (params: any) => {
  return request({
    url: '/workbenches/list',
    method: 'GET',
    params,
  });
};
// 测震告警折线图
export const seismChartApi = (params: any) => {
  return request({
    url: '/workbenches/getStationChart',
    method: 'GET',
    params,
  });
};

// 通知公告列表
export const noticeListApi = (params: any) => {
  return request({
    url: '/notice/list',
    method: 'GET',
    params,
  });
};

/**
 * 已读通知公告
 * @param id
 * @returns
 */
export const readNotice = (id: number) =>
  request({
    url: `/notice/read/${id}`,
    method: 'PUT',
  });

// 快捷菜单
export const quickMenuApi = () => {
  return request({
    url: '/workbenches/quickMenu',
    method: 'GET',
  });
};

// 配置菜单
export const configMenuApi = (data: any) => {
  return request({
    url: '/workbenches/configMenu',
    method: 'POST',
    data,
  });
};

// 菜单选择列表
export const menuListApi = () => {
  return request({
    url: '/workbenches/menuList',
    method: 'GET',
  });
};

// 恢复测震站
export const alarmListStationRestoreApi = (data: any) => {
  return request({
    url: '/alarmListStation/restore',
    method: 'PUT',
    data,
  });
};
